<?php

namespace App\Validate\Logic;

use App\Validate\VipSettingsValidate;

class VipSettingsLogic extends BaseLogic
{
    /**
     * @return VipSettingsValidate
     * author:fhc
     * desc:获取验证器
     * created_at: {2020/10/16}----10:25 上午
     */
    private function getValidate():VipSettingsValidate{
        return  new VipSettingsValidate;
    }

    /**
     * @param array $params
     * author:fhc
     * desc:登录的
     * created_at: {2020/10/16}----10:25 上午
     * @throws SysExceptions
     */
    public function add_vip($params = []){
        $validate = $this->getValidate();
        if(!$validate->scene('add_vip')->check($params)){
            $this->error($validate->getError());
        }
    }

    public function edit_vip(array $params)
    {
        $validate = $this->getValidate();
        if(!$validate->scene('edit_vip')->check($params)){
            $this->error($validate->getError());
        }
    }

    public function del_vip(array $params)
    {
        $validate = $this->getValidate();
        if(!$validate->scene('del_vip')->check($params)){
            $this->error($validate->getError());
        }
    }

    public function add_vip_order(array $params)
    {
        $validate = $this->getValidate();
        if(!$validate->scene('add_vip_order')->check($params)){
            $this->error($validate->getError());
        }
    }
}
